class RemarkMgrController {

    def index = { }

    def edit = { }

    def delete = {
        def remarkInstance = Remark.get(params.id)
        if (remarkInstance) {
            try {
                remarkInstance.delete(flush: true)
                flash.message = "删除成功"
                redirect(action: "show",controller:"post",id:params.postId)
            }
            catch (org.springframework.dao.DataIntegrityViolationException e) {
                flash.message = "${message(code: 'default.not.deleted.message', args: [message(code: 'remark.label', default: 'Remark'), remarkInstance])}"
                redirect(action: "show",controller:"post",id:params.postId)
            }
        }
        else {
            flash.message = "${message(code: 'default.not.found.message', args: [message(code: 'remark.label', default: 'Remark'), params.id])}"
            redirect(action: "show",controller:"post",id:params.postId)
        }
    }
}
